#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
class Complex
{
private:
	int real;
	int image;
public:
	friend Complex complex_add(Complex& c1, Complex& c2);
	friend Complex operator+(Complex& c1, Complex& c2);
	Complex(int r,int i):real(r),image(i){}
	void print()
	{
		cout << "(" << real << "," << image << ")" << endl;
	}
	Complex complex_add(Complex&another)
	{
		Complex temp(this->real+another.real,this->image+another.image);
		return temp;
	}
	Complex operator+(Complex& another)
	{
		Complex temp(this->real + another.real, this->image + another.image);
		return temp;
	}
};
Complex complex_add(Complex& c1, Complex& c2)
{
	Complex temp(c1.real + c2.real, c1.image + c2.image);
	return temp;
}
Complex operator+(Complex& c1, Complex& c2)
{
	Complex temp(c1.real + c2.real, c1.image + c2.image);
	return temp;
}
int main()
{
	Complex c1(1, 2);
	Complex c2(3, 4);
	//Complex c3 = complex_add(c1, c2);
	//c3.print();
	//Complex c3=c2.complex_add(c1);
	//c3.print();
	//Complex c3 = operator+(c1,c2);//operator+(c1,c2);
	//c3.print();
	Complex c3 = c2.operator+(c1);
	c3.print();
	return 0;
}